There is an image reading device which is included in a scanner, a photocopier, a FAX machine, a multi-function printer, and the like, and which optically reads a document placed on a platen. If this image reading device erroneously determines a document size, it cannot correctly read an image and causes the loss or the like of image data. Therefore, a document size detection mechanism for detecting the size of a document to be read is mounted on the image reading device.
As the mechanism for detecting the document size, there is an approach of detecting the document size with an image sensor using a charge coupled device (hereinafter, CCD). According to this approach using a CCD, the number of reflection sensors expensive as compared with a CCD can be reduced to provide an inexpensive configuration, and the document width can be detected by utilizing the characteristic that the brightness of a document portion increases and the brightness of a non-document portion decreases by reading a document utilizing the light source of a scanner when a pressure plate is open.
However, in this approach using a CCD, the ambient light may cause erroneous detection and cause erroneous size detection, resulting in occurrence of waste sheet during copying. As such an approach with an ambient-light countermeasure, there is the technique disclosed in Patent Literature 1. The technique disclosed in this Patent Literature 1 is an approach of cancelling out the influence of the ambient light by calculating a difference between reading when a light source is ON and reading when the light source is OFF.
However, a light amount variation of the ambient light is not assumed in this approach, and therefore when there is the ambient light whose brightness varies, such as in a fluorescent lamp and/or in LED visible light communications, the difference between ON/OFF of a light source may fail to cancel out the influence of the ambient light. In contrast, there is a method for reducing the influence of the variation in brightness by increasing the read time and performing calculation, such as time averaging, by taking into consideration the influence of the ambient light whose brightness varies.